/**
 * @author Mirko Bordjoski
 */	
package org.piwik.requests
{
	//import org.piwik.methods.VisitsSummaryMethods;
	
	/**
	* The VisitsSummary methods are used to get the informations about visits from piwik analitycs. 
	*/	
	public class VisitsSummary
	{
		
		public static const GET:String = "VisitsSummary.get";
		public static const GET_VISITS:String = "VisitsSummary.getVisits";
		public static const GET_UNIQUE_VISITORS:String = "VisitsSummary.getUniqueVisitors";
		
		
		public function VisitsSummary(){}
		
		
		
		
		
		/**
		* Returns summary information about visits.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD.
		* @param	$period			[optional] Can be 'day', 'week', 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		 * 
		 * @see org.piwik.logic.PiwikFormatter
		*/
		public static function getVisitsSummary($date:String = "last30", $period:String = "day", $filterLimit:uint = 20):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = VisitsSummary.GET; //VisitsSummaryMethods.GET;
			req.period = $period;
			req.requestType = "getVisitsSummary";
			
			return req;				
		}
		
		/**
		* Returns the number of visits.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD.
		* @param	$period			[optional] Can be 'day', 'week', 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		 * 
		 * @see org.piwik.logic.PiwikFormatter
		*/
		public static function getVisits($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 20):PiwikRequest
		{			
			var req2:PiwikRequest = new PiwikRequest();
			req2.date = $date;
			req2.filter = $filterLimit;
			req2.moduleMethod = VisitsSummary.GET_VISITS; //VisitsSummaryMethods.GET_VISITS;
			req2.period = $period;
			req2.requestType = "getVisits";
			
			return req2;				
		}
		
		/**
		* Returns the number of uniq visits.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD.
		* @param	$period			[optional] Can be 'day', 'week', 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		 * 
		 * @see org.piwik.logic.PiwikFormatter
		*/
		public static function getUniqueVisitors($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 20):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = VisitsSummary.GET_UNIQUE_VISITORS;//VisitsSummaryMethods.GET_UNIQUE_VISITORS;
			req.period = $period;
			req.requestType = "getUniqueVisitors";
			
			return req;				
		}
	}
}